7  Author Contributions

Essential to the practice of Open Science is being transparent and taking responsibility. This means that we should be clear about who did want in a group project. We can leverage YAML to record what roles each author as shown back in Section 1.4 and Listing 1.10.

In addition to setting roles as part of the author metadata, we also need to list contributions in two other places: each code chunk and at the end of the report.

7.1 Contributions in Code Chunks

Listing contributions in code chunks can vary in the amount of details. However, the most basic way of listing contributions is to list who is taking responsibility for a particular block of code. When working in a team, we strongly recommend using a two-layered approach to listing responsibility.

  • If using a paired programming approach,
    • The Driver (or Writer) is the person who wrote the code while
    • The Navigator (or Observer) is the person who was strategizing, telling the driver what to do, and checking what was typed.
  • General Approach
    • The Author is the person who conceptualized and wrote the code,
    • The Reviewer is the person(s) who checked the author’s work and signed off.

You can use either approach when working in teams. However, if you are going to use the terms Driver/Navigator (or Writer/Observer), then you need to make sure that you truly used paired programming. In any case, you’ll use these terms in your code chunks to convey who is taking responsibility. Listing 7.1 shows an easy way to convey who contributed to a code chunk and is therefore taking responsibility. In this instance, Neil took responsibility for originally coming up with the code. Matt took responsibility for making sure that Neil’s code was appropriate (and well formatted, commented, etc.); if it wasn’t Matt should tell Neil what issues there are.

Listing 7.1: Example of List Contributions to Code
```{r}
#| label: exampleContribution

# Load and Wrangle Armed Forces Data -----
## Author: Neil Hatfield
## Reviewer:: Matt Beckman
## This code will load the armed forces data and then wrangle it so
## that a case is an individual solider.

# [Code omitted for this example]

```
TipBest Practice

At bare minimum for your Course Project, you should list who is taking responsibility for each and every code chunk. This helps convey who we should direct questions to if any come up.

7.2 Contributions Paragraph

The second additional place we need to list author contributions is a section at the end of our report, before the References and any appendices. In this section, we will put a paragraph or listing of what each other contributed. The choice of formatting is up to you: you can use complete sentences or just list each author (by full name or initials) followed by which roles they fulfilled. For example,

Author Contributions

Neil J. Hatfield: Conceptualization, Project Administration, Supervision, Writing-Original Draft, Writing-Review & Editing. Veronica Bubb: Formal Analysis, Methodology, Visualization, Writing-Original Draft, Writing-Review & Editing. Matthew Beckman: Data Curation, Formal Analysis, Resources, Visualization, Writing-Original Draft, Writing-Review & Editing.

This is a common approach to the Author Contributions Section. Notice that each author has their name in boldface. You could alternatively use each author’s initial (e.g., NJH, VB, and MB) in place of their names.

In this example and that of Listing 1.10, we have made use of pre-defined roles, which are explained in the following section.

7.2.1 Author Roles

In 2022 the National Information Standards Organization (NISO) approved the Contributor Role Taxonomy (CRediT) for use. CRediT provides a set of 14 standardized roles that cover the key type of contributions that are typically made in research settings. This taxonomy should cover most of what you’ll encounter in your careers. Table 7.1 provides a quick overview of each role.

Table 7.1: CRediT Roles
Role Definition
Conceptualization Ideas; formulation or evolution of overarching research goals and aims.
Data Curation Management activities to annotate (produce metadata), scrub data and maintain research data (including software code, where it is necessary for interpreting the data itself) for initial use and later re-use.
Formal Analysis Application of statistical, mathematical, computational, or other formal techniques to analyze or synthesize study data.
Funding Acquisition Acquisition of the financial support for the project leading to this publication.
Investigation Conducting a research and investigation process, specifically performing the experiments, or data/evidence collection.
Methodology Development or design of methodology; creation of models.
Project Administration Management and coordination responsibility for the research activity planning and execution.
Resources Provision of study materials, reagents, materials, patients, laboratory samples, animals, instrumentation, computing resources, or other analysis tools.
Software Programming, software development; designing computer programs; implementation of the computer code and supporting algorithms; testing of existing code components.
Supervision Oversight and leadership responsibility for the research activity planning and execution, including mentorship external to the core team.
Validation Verification, whether as a part of the activity or separate, of the overall replication/reproducibility of results/experiments and other research outputs.
Visualization Preparation, creation and/or presentation of the published work, specifically visualization/data presentation.
Writing – Original Draft Preparation, creation and/or presentation of the published work, specifically writing the initial draft (including substantive translation).
Writing – Review & Editing Preparation, creation and/or presentation of the published work by those from the original research group, specifically critical review, commentary or revision – including pre- or post-publication stages.

7.2.2 Making the Paragraph/List

Making the paragraph or list for the Author Contributions section can be as easy or as complicated as you want to make this task.

7.2.2.1 Manually Type

The easiest approach is to just type the paragraph. The upside to this approach is that this should always work. The downside is that you have to remember to manually update this text as things change. This also means that you need to do updates in two places: the YAML Header and this paragraph.

7.2.2.2 By Scripting

An alternative approach leverages the author metadata from your YAML header. This information is accessible, but only during the rendering process. This makes working with the data a bit challenging, but not impossible. With the exception of one specialized formatting command and the command to get the metadata, this is a data wrangling task that you can do. To help you out I’ll provide the following hints based upon an approach I used.

  1. The command rmarkdown::metadata invokes the metadata during the rendering process.
  2. Depending on whether you used author or authors in your YAML header, rmarkdown::metadata$authors will return a list object.
  3. I found it helpful to create a new list object to store data frames I constructed for each author.
  4. As part of a for loop, I extracted out each author’s raw metadata, transformed that into a data.frame or tibble object.
    1. My data frames were too long but pivoting wouldn’t work out well for me. So I summarized the role information by pasting and collapsing rows by author.
    2. I changed the new role text by switching the strings to title case.
  5. Once I had a my list of cleaned data frames, I bound their rows together.
  6. I used sprintf to build custom formatted character strings with fmt = "__%s:__ %s." and the appropriate inputs from by bounded data frame and saved the output.
  7. I then used in-line code to paste and collapse my formatted character strings so that Quarto would make the text look like narrative text instead of raw code output.

While this approach is more complicated, especially with the needed data wrangling, the benefit is that you are leveraging the meatadata you’ve already provided. A benefit is that you only need to update your YAML Header; this paragraph will automatically update when you next render the Quarto document.

ImportantAcademic and Research Integrity

Author Contributions are vital for both academic and research integrity. By making sure that we accurately explain who did what in any project, we give ourselves a mechanism to hold ourselves and each other accountable. In the event of problematic or misconduct, Author Contributions help to divide up the blame. However, keep in mind that everyone in the project is ultimately responsible.